<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %> 
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
 <meta name="renderer" content="webkit">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title> 客户还款能力信息</title>
<jsp:include page="../../import.jsp" flush="true" />
</head>
<body class="iframeBody">
 <div class="Wrapper">
   <div class="pageIn2layout">
<jsp:include page="../../project/prjbscinfo/prjGuarInvestRpt.jsp" flush="true" >
		<jsp:param name="currentNav" value="prjcstrepayabi"/>
</jsp:include>
<div class="pageIn2L_mid">
        <div>
           <div id="pageInTab" class="pageInTab">
                    <form id="prj_cst_repay_abi_form">
                        <div class="fieldset1 tabel_col clearFix">
		                      <div class="fieldBox col_33">
				                    <div class="label">自有车辆数量（辆）</div>
				                    <div class="field">
				                        <input name="ownCarNum"  id="ownCarNum" type="text" class="ui-textbox" value="${abi.ownCarNum }"  >
				                    </div>
		               		 </div>
		               		  <div class="fieldBox col_33">
				                    <div class="label">管理车辆数量（辆）</div>
				                    <div class="field">
				                        <input name="mgrCarNum"  id="mgrCarNum" type="text" class="ui-textbox"   value="${abi.mgrCarNum }"  >
				                    </div>
		               		 </div>
		               		   <div class="fieldBox col_33">
				                    <div class="label">客户数量</div>
				                    <div class="field">
				                        <input name="cstNum"  id="cstNum" type="text" class="ui-textbox" value="${abi.cstNum }" >
				                    </div>
		               		 </div>
		               		  <div class="fieldBox col_33">
				                    <div class="label">从业年限</div>
				                    <div class="field">
				                        <input name="year"  id="year" type="text" class="ui-textbox" value="${abi.year }">
				                    </div>
		               		 </div>
		               		  <div class="fieldBox col_100">
				                    <div class="label">房产、土地情况</div>
				                    <div class="field">
				                        <input name="hsePptLandSts"  id="hsePptLandSts" type="text" class="ui-textbox" value="${abi.hsePptLandSts }" >
				                    </div>
		               		 </div>
		               		   <div class="fieldBox col_33">
				                    <div class="label"> 资产规模</div>
				                    <div class="field">
				                        <input name="assScl"  id="assScl" type="text" class="ui-textbox" value="${abi.assScl }">
				                    </div>
		               		 </div>
		               		  <div class="fieldBox col_33">
				                    <div class="label">负债</div>
				                    <div class="field">
				                        <input name="debt"  id="debt" type="text" class="ui-textbox" value="${abi.debt }" >
				                    </div>
		               		 </div>
		               		   <div class="fieldBox col_33">
				                    <div class="label">净资产</div>
				                    <div class="field">
				                        <input name="netAss"  id="netAss" type="text" class="ui-textbox" value="${abi.netAss }">
				                    </div>
		               		 </div>
		               		   <div class="fieldBox col_33">
				                    <div class="label">流动资产</div>
				                    <div class="field">
				                        <input name="liqAss"  id="liqAss" type="text" class="ui-textbox" value="${abi.liqAss }">
				                    </div>
		               		 </div>
		               		   <div class="fieldBox col_33">
				                    <div class="label"> 固定资产</div>
				                    <div class="field">
				                        <input name="fixAss"  id="fixAss" type="text" class="ui-textbox" value="${abi.fixAss }">
				                    </div>
		               		 </div>
		               		  <div class="fieldBox col_33">
				                    <div class="label">资产负债率</div>
				                    <div class="field">
				                        <input name="assDebtRate"  id="assDebtRate" type="text" class="ui-textbox"  data-tofix="2"  value="${abi.assDebtRate }" >
				                    </div>
		               		 </div>
		               		   <div class="fieldBox col_33">
				                    <div class="label">主营业务收入(元)</div>
				                    <div class="field">
				                        <input name="mainBusiIncm"  id="mainBusiIncm" type="text" class="ui-textbox" value="${abi.mainBusiIncm }">
				                    </div>
		               		 </div>
		               		    <div class="fieldBox col_33">
				                    <div class="label"> 净利润（元）</div>
				                    <div class="field">
				                        <input name="netPrft"  id="netPrft" type="text" class="ui-textbox" value="${abi.netPrft }" >
				                    </div>
		               		 </div>
		               		    <div class="fieldBox col_33">
				                    <div class="label"> 上年利润（元）</div>
				                    <div class="field">
				                        <input name="lstYearPrft"  id="lstYearPrft" type="text" class="ui-textbox" value="${abi.lstYearPrft }" >
				                    </div>
		               		 </div>
		               		    <div class="fieldBox col_100">
				                    <div class="label"> 对外抵押担保情况说明</div>
				                    <div class="field">
				                        <input name="extMbDesc"  id="extMbDesc" type="text" class="ui-textbox" value="${abi.extMbDesc }" >
				                    </div>
		               		 </div>
		               		 
		               		 
		               		<div class="fieldBox col_100">
				                    <div class="label"> 与融资租赁业务申请人关系说明</div>
				                    <div class="field">
				                        <input name="apyRelDesc"  id="apyRelDesc" type="text" class="ui-textbox" value="${abi.apyRelDesc }" >
				                    </div>
		               		 </div>
		               		 
		               		 	<div class="fieldBox col_100">
				                    <div class="label"> 担保能力说明</div>
				                    <div class="field">
				                        <input name="guarAbiDesc"  id="guarAbiDesc" type="text" class="ui-textbox" value="${abi.guarAbiDesc }" >
				                    </div>
		               		 </div>
		               		 
		               		   <div class="fieldBox col_50">
				                    <div class="label">是否有犯罪记录或诉讼案件</div>
				                    <div class="field">
				                     <select name="isCrimRecd"  id="isCrimRecd"   >
				                      <c:forEach items="${YesNoList}" var="opt">
		                                 <option value="${opt.key}"
		                                 <c:if test="${opt.key==abi.isCrimRecd }">selected="selected"</c:if>
		                                 >${opt.value}</option>
	                                </c:forEach>
	                                </select>
				                    </div>
		               		 </div>
		               		  <div class="fieldBox col_50">
				                    <div class="label">是否曾经被金融机构执行资产</div>
				                    <div class="field">
				                      <select name="isFinaInstAss"  id="isFinaInstAss"   >
				                     <c:forEach items="${YesNoList}" var="opt">
		                                 <option value="${opt.key}"
		                                 <c:if test="${opt.key==abi.isFinaInstAss }">selected="selected"</c:if>
		                                 >${opt.value}</option>
	                                </c:forEach>
	                                </select>
				                    </div>
		               		 </div>
                                <div class="fieldBox col_50">
                                <div class="label"  id="apyCrdtCdLable">担保企业我司信用记录</div>
                                <div class="field">
                                 <select name="apyCrdtCd"  id="apyCrdtCd"   >
	                                <c:forEach items="${keyList}" var="opt">
	                                 <option value="${opt.key}"
	                                 <c:if test="${opt.key==abi.apyCrdtCd }">selected="selected"</c:if>
	                                 >${opt.value}</option>
	                                </c:forEach>
	                                </select>
                                </div>
                            </div>
                            <div class="fieldBox col_50" >
                                <div class="label"> 法人代表我司信用记录</div>
                                <div class="field">
                                 <select name="corpReprCrdtCd"  id="corpReprCrdtCd"   >
	                                <c:forEach items="${keyList}" var="opt">
	                                 <option value="${opt.key}"
	                                 <c:if test="${opt.key==abi.corpReprCrdtCd}">selected="selected"</c:if>
	                                 >${opt.value}</option>
	                                </c:forEach>
	                                </select>
                                </div>
                            </div>
		               		 
                              <div class="fieldBox col_50"  style="display: none">
                                <div class="field"> 
                              		<input name="abiId" id="abiId" type="text"  value="${abi.id }" >
                                </div>
                            </div>
                            </div>
                    </form>
                    </div>
                     <div class="btnsBox">
				                <span id="prj_cst_repay_abi_add_btn_id" class="sq-button sq-button-round" onclick="save();"><!-- <i class="sqBtnIco_10"></i> -->保存</span>
           				 </div>
                 </div>
               
</div>
</div>
</div>

<script type="text/javascript">
var prjId = '${prjId}';
var cstId = '${cstId}';
var cstType = '${cstType}';
var detailFlag = '${detailFlag}';
var cstRlCd = '${cstRlCd}';
$(function () {
	initData();
	if(detailFlag=="true"){
		$("#prj_cst_repay_abi_add_btn_id").hide();
		if($("#ownCarNum")){
			 liger.get("ownCarNum").setDisabled(true);
		}
		if($("#mgrCarNum")){
			 liger.get("mgrCarNum").setDisabled(true);
		}
		if($("#cstNum")){
			 liger.get("cstNum").setDisabled(true);
		}
		if($("#year")){
			 liger.get("year").setDisabled(true);
		}
		if($("#hsePptLandSts")){
			 liger.get("hsePptLandSts").setDisabled(true);
		}
		if($("#assScl")){
			 liger.get("assScl").setDisabled(true);
		}
		if($("#debt")){
			 liger.get("debt").setDisabled(true);
		}
		if($("#netAss")){
			  liger.get("netAss").setDisabled(true);
		}
		if($("#liqAss")){
			  liger.get("liqAss").setDisabled(true);
		}
		if($("#fixAss")){
			  liger.get("fixAss").setDisabled(true);
		}
		if($("#assDebtRate")){
			  liger.get("assDebtRate").setDisabled(true);
		}
		if($("#mainBusiIncm")){
			  liger.get("mainBusiIncm").setDisabled(true);
		}
		if($("#netPrft")){
			  liger.get("netPrft").setDisabled(true);
		}
		if($("#lstYearPrft")){
			  liger.get("lstYearPrft").setDisabled(true);
		}
		
		if($("#extMbDesc")){
			  liger.get("extMbDesc").setDisabled(true);
		}
		
		if(liger.get("isCrimRecd")){
			  liger.get("isCrimRecd").setDisabled(true);
		}
		if(liger.get("isFinaInstAss")){
			  liger.get("isFinaInstAss").setDisabled(true);
		}
		if(liger.get("apyCrdtCd")){
			  liger.get("apyCrdtCd").setDisabled(true);
		}
		if(liger.get("corpReprCrdtCd")){
			  liger.get("corpReprCrdtCd").setDisabled(true);
		}
		
		if(liger.get("apyRelDesc")){
			  liger.get("apyRelDesc").setDisabled(true);
		}
		if(liger.get("guarAbiDesc")){
			  liger.get("guarAbiDesc").setDisabled(true);
		}
		
		
		
	}
});

	//初始化数据
	function initData(){
		$("#prj_cst_repay_abi_form").ligerForm({
		    validate: true
		});
	}
	
	function save(){
        var ligerForm = liger.get("prj_cst_repay_abi_form");
        if (!ligerForm.valid()) {
            top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO,SQ_type: "warning"});
            return false; //验证不通过，不执行以下代码
        }
        var data = ligerForm.getData();
        data["cstRlCd"] = cstRlCd;
        var url = '<%=path%>/project/prjcstrepayabi/add.do';
        var abiId = $("#abiId").val();
        data["id"]= abiId;
        data["prjId"]= prjId;
        data["cstId"]= cstId;
        var wait_dialog;
        $.ajax({
    		type: 'post',
    		dataType:'json',
    		data:data,
    		url: url,
    		beforeSend: function(){
		          wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
		     },
    		success:function(msg){
    			 wait_dialog.close();
    			 if(msg.success == 1){
    				 $("#abiId").val(msg.data);
    				 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "success"});
    			 }else{
    				 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
    			 }
    		}
    	});
	}
    </script>
</body>
</html>